In current hard disk drives (HDDs), the data size based on the magnetic disk format is often greater than the size of data transferred from a host (computer). The data size based on the magnetic disk format refers to a unit of writing or reading to or from the magnetic disk (hereinafter also referred to as a medium). If, for example, error correction code (ECC) processing is performed, the unit of ECC processing is also considered a reference for the data size. The data size unit based on the magnetic disk format may further vary depending upon the efficiency of use of the medium, the density of recording, etc. As the data size unit is increased, the efficiency of use of the medium basically increases. However, in accordance with the increase in data size unit, more time is required to process a small amount of data. Also considering such a tradeoff, the data size unit may be determined.
In the above-mentioned HDDs, when the size of data to be written (rewritten) by the host is smaller than the data size unit based on the magnetic disk format, data corresponding to one data size unit and including the data to be rewritten is once read from the medium and stored in a data buffer, such as a synchronous dynamic random access memory (SDRAM). At this time, in general, the data of one data size unit is stored in the data buffer after being subjected to processing, such as ECC or parity check, for data protection. Then, part of the data of one data size unit is rewritten in the data buffer with rewrite data sent from the host. The data of one data size unit, which has been partially rewritten, is again subjected to processing, such as ECC or parity check, and is then written to the medium (magnetic disk).